package com.example.license.entity;

import com.example.license.LicenseUtils.CustomLicenseManager;
import com.example.license.service.IUserClientService;
import de.schlichtherle.license.LicenseManager;
import de.schlichtherle.license.LicenseParam;
import org.springframework.stereotype.Service;

/**
 * LicenseManager单例模式下的证书管理器
 */
@Service
public class LicenseManagerHolder {

    private static LicenseManager licenseManager;

    public static synchronized LicenseManager getLicenseManager(LicenseParam licenseParams, IUserClientService service) {
        if (licenseManager == null) {
            licenseManager = new CustomLicenseManager(licenseParams,service);
        }
        return licenseManager;
    }
}
